from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from base.basepage import BasePage


# 启动页
class StartPage(BasePage):
    def readAgreement(self):
        try:
            WebDriverWait(self.driver, 5).until(EC.visibility_of_element_located((By.ID, "iv_cycle_checked")))
            self.find_ele_click(By.ID, "iv_cycle_checked")
            self.find_ele_click(By.ID, "confirm_btn")
            print("点击已阅读和同意按钮")
        except TimeoutException as e:
            print("未找到已阅读和同意按钮，或者已经同意了")
